package com.xygj.vueblog.service;

import com.xygj.vueblog.common.lang.Result;
import com.xygj.vueblog.entity.User;
import com.xygj.vueblog.mapper.UserMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
@Component
public class UserService {

    @Autowired
    UserMapper userMapper;
    public User getById(int id){

        System.out.println("查询用户成功");
        return userMapper.selectById(id);
    }

    public User queryUserByName(String name,String password){
        User user = userMapper.queryUserByName(name,password);
        return user;

    }

    public User findName(String name){
        User user = userMapper.findName(name);
        return user;

    }
}
